\$1

Section: Misc. Reference Manual Pages (\$2)
Updated: MHPPED
Index Return to Main Contents
 

NAME

mhpped - pre-process backticks in MH composition templates  

SYNOPSIS


mhpped [-(no)debug] [-editor editor] [-noeditor] [-(no)entire] [-(no)verbose] [file]  

DESCRIPTION

Mhpped pre-processes shell-like backticks (``) in e-mail message composition templates used by comp, repl, and forw. Each shell command inside a pair of backticks is executed via /bin/sh, and the resulting output is substituted into the header component.

If the result of a backtick construct is empty, and nothing "important" surrounds the backtick construct, then the entire header component is omitted. The criterion for an "important" string preceding the backtick construct is something that looks neither like a header component nor like whitespace. The criterion for an "important" string following the backtick construct is something that isn't whitespace.

Only the header components are processed unless -entire is specified. If -entire is specified then backticks in the message composition template body as well as in the header are processed. the -noentire option negates the -entire option. The default is -noentire.

The -editor option specifies an editor program to invoke after processing. The -noedit option negates the -editor option. The default is -noedit. If the MH profile component "mhpped-next" is present, then whatnow(1) will use the editor specified in that component when "edit" is typed at the "What now?" prompt.

The -help option prints a help message and exits.

The -verbose option causes mhpped to print the commands being executed in the backticks, as well as miscellaneous shell commands executed by mhpped. The -noverbose option negates the -verbose option. The default is -noverbose.

The -debug option also prints the commands, but does not execute them. The -nodebug option negates the -debug option. The default is -nodebug.

 

EXAMPLE

You may install mhpped in any directory occurring in your $PATH environment variable. My copy is installed in my personal bin directory, "~/bin".

Once mhpped has been installed, you may specify an "-editor mhpped" option for comp, forw, or repl.

You may also invent your own mail composition commands, and specify "mhpped" as the default editor in the appropriate MH profile component.

Here is an example test configuration using mhpped with a version of comp named "ppcomp". First, run these csh commands to create the "ppcomp" command:


    % ln -s `which comp` ~/bin/ppcomp

    % rehash

Then in your .mh_profile, add these lines:

ppcomp:         -editor mhpped -form components.t
mhpped:         -entire -verbose -editor prompter

Then in your Mail directory, create a file named "components.t" with these example lines:

X-nothing: `echo ""`
To:
Cc:
Fcc: `folder -fast`
X-local-time: `date`
Subject:
-----------

 
This should not be expanded unless -entire is given: `date`

The first line of the "components.t" file, which returns an empty string, is there as an example of a line that would be omitted in the processed composition file.

When everything is ready, invoke "ppcomp" to see what happens.

 

AUTHOR

Jerry Sweet <jsweet@irvine.com>.

Mhpped was taken from "bipp", a slightly simpler shell/awk program by Jerry Peek <jpeek@ora.com>.


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
AUTHOR

This document was created by man2html, using the manual pages.
Time: 04:07:43 GMT, January 16, 2023